﻿CREATE TABLE [dbo].[Internare] (
    [IDInternare]            INT           IDENTITY (1, 1) NOT NULL,
    [NrFisa]                 VARCHAR (20)  NOT NULL,
    [DataFisa]               DATETIME      NOT NULL,
    [IDPacient]              INT           NOT NULL,
    [Greutate]               FLOAT (53)    NOT NULL,
    [Suprafata]              FLOAT (53)    NOT NULL,
    [MedicCurant]            VARCHAR (50)  NOT NULL,
    [Creatinina]             FLOAT (53)    NOT NULL,
    [Ambulator]              BIT           CONSTRAINT [DF_Internare_Ambulator] DEFAULT ((0)) NOT NULL,
    [CazNou]                 BIT           CONSTRAINT [DF_Internare_CazNou] DEFAULT ((1)) NOT NULL,
    [Observatii]             VARCHAR (150) NOT NULL,
    [DataCreare]             DATETIME      CONSTRAINT [DF_Internare_DataCreare] DEFAULT (getdate()) NOT NULL,
    [OncoDataStartChimioTer] DATETIME      NOT NULL,
    [OncoDataEndChimioTer]   DATETIME      NOT NULL,
    [OncoLocalizare]         SMALLINT      NOT NULL,
    [OncoCiclu]              SMALLINT      NOT NULL,
    [OncoDataStartCicluUrm]  DATETIME      NOT NULL,
    [OncoIDProtocol]         SMALLINT      NOT NULL,
    [CodUnitate]             SMALLINT      CONSTRAINT [DF_Internare_CodUnitate] DEFAULT ((0)) NOT NULL,
    [Asistent]               VARCHAR (50)  NULL,
    CONSTRAINT [PK_Internare] PRIMARY KEY CLUSTERED ([IDInternare] ASC),
    CONSTRAINT [FK_Internare_onco_Protocoale] FOREIGN KEY ([OncoIDProtocol]) REFERENCES [dbo].[onco_Protocoale] ([IDProtocol]),
    CONSTRAINT [FK_Internare_Pacienti] FOREIGN KEY ([IDPacient]) REFERENCES [dbo].[Pacienti] ([IDPacient]),
    CONSTRAINT [FK_Internare_Unitati] FOREIGN KEY ([CodUnitate]) REFERENCES [dbo].[Unitati] ([CodUnitate])
);

